<div id="outer-collection"> <?php
$attributes = array('class' => 'savecomment', 'id' => 'savecomment');
			
//			date('Y-m-d H:i:s')echo date("2002-09-08".' H:i:s');

//if($this->session->userdata('EnableGuestComment')==1			
			 
echo form_open('blog/post/'.$this->uri->segment(3), $attributes);
echo "<div class=\"error\" >".$this->validation->error_string."</div>"; ?>
<?=form_hidden('urltitle',$this->uri->segment(3));?>
   
<table width="100%" border="0">
     
   
<thead>
<th colspan="2" align="center">Leave a comment</td>
</thead>
     <?php 
	  $login = $this->session->userdata('logged_in');
		if($login)
		{	
			$name=$this->session->userdata('first_name');
			$name.=" ".$this->session->userdata('last_name');
			$email=$this->session->userdata('email');
			$user_id=$this->session->userdata('user_id');
		
			echo form_hidden('name',$name);
			echo form_hidden('email',$email);
			echo form_hidden('user_id',$user_id);
			echo form_hidden('guesturl',"");

		}
		else
		{
		
	 ?>
      <tr>
        <td>Name</td>
        <td><input name="name" size="30" class="required alphanumeric" title="Please write only alphanumeric characters, this field is required." value="<?=$this->validation->name;?>" /></td>
      </tr>
      <tr>
        <td>Email Address</td>
        <td><input name="email" size="30" value="<?=$this->validation->email;?>" /></td>
      </tr>
      <tr>
        <td>Url</td>
        <td><input name="guesturl" size="30" value="<?=$this->validation->guesturl;?>" /></td>
      </tr>
      <?php } ?>
      
      <tr>
        <td>Comment</td>
        <td><textarea name="commentbox" rows="5" cols="35"><?=$this->validation->commentbox;?></textarea></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="post"  class="small-button" value="Submit" />
        <input type="reset" name="Reset" class="small-button" id="button" value="Reset" /></td>
      </tr>
      <tfoot><tr><td>&nbsp;</td><td>&nbsp;</td></tfoot>
    </table>
    
    
    
    
    
    
</form></div>
